{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'1.14.3'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np     #引入numpy包一般使用np作为别名\n",
    "np.__version__         #查看numpy的版本"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "np?                 #查看numpy内置文档"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "l = list(range(10))\n",
    "l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "int"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(l[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "l2 = [str(item) for item in range(10)]\n",
    "l2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(l2[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[bool, str, int, float]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "l3 = [True,\"2\",2,3.0]\n",
    "[type(item) for item in l3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array('i', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import array\n",
    "l = list(range(10))\n",
    "A=array.array('i',l)\n",
    "A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4, 5])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array([1,2,3,4,5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 2., 3., 4., 5.])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array([1,2.0,3,4,5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 2., 3., 4., 5.], dtype=float32)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array([1,2,3,4,5],dtype='float32')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[2, 3, 4],\n",
       "       [4, 5, 6],\n",
       "       [6, 7, 8]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array([range(i,i+3) for i in [2,4,6]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.zeros(10,dtype=int) #长度为10的数组 初始化为0  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 1., 1., 1., 1.],\n",
       "       [1., 1., 1., 1., 1.],\n",
       "       [1., 1., 1., 1., 1.]])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.ones((3,5),dtype=float)  #3*5的浮点型2维数组 值为1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[3.14, 3.14, 3.14, 3.14, 3.14],\n",
       "       [3.14, 3.14, 3.14, 3.14, 3.14],\n",
       "       [3.14, 3.14, 3.14, 3.14, 3.14]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.full((3,5),3.14)  #3*5的浮点型2维数组 值为3.14"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0,  2,  4,  6,  8, 10, 12, 14, 16, 18])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange(0,20,2) #从0开始，到20(不包括)结束，步长为2，创建数组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.  , 0.25, 0.5 , 0.75, 1.  ])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linspace(0,1,5)  #0到1均匀分配5份"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.64317568, 0.06826082, 0.27854381],\n",
       "       [0.61532079, 0.25047228, 0.20178621],\n",
       "       [0.69307642, 0.72852889, 0.66447064]])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.random((3,3)) #创建3*3的二维数组 其值为0-1之间的随机数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.61878491, -1.40328932, -0.6366383 ],\n",
       "       [-0.37752531,  1.66831042,  0.75000903],\n",
       "       [ 0.53675148, -0.91286063, -0.86906144]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.normal(0,1,(3,3)) #创建3*3的二维数组 其值为正态分布随机数(均值为0，方差为1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 5, 9],\n",
       "       [6, 4, 2],\n",
       "       [2, 6, 0]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.randint(0,10,(3,3))#创建3*3的二维数组 其值为[0,10)间的随机整数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 0., 0.],\n",
       "       [0., 1., 0.],\n",
       "       [0., 0., 1.]])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.eye(3) #创建一个3*3的单位二维数组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 1., 1.])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.empty(3) #创建一个由3个元素组成的未初始化的数组  其值为内存中的任意值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int16)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.zeros(10,dtype='int16')  #字符串指定类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int16)"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.zeros(10,dtype=np.int16) #numpy对象指定"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "(3, 4, 5)\n",
      "60\n",
      "int64\n",
      "8\n",
      "480\n"
     ]
    }
   ],
   "source": [
    "np.random.seed(0)  #指定随机种子，包证每次生成的随机值一样\n",
    "x1=np.random.randint(10,size=6)\n",
    "x2=np.random.randint(10,size=(3,4))\n",
    "x3=np.random.randint(10,size=(3,4,5))\n",
    "print(x3.ndim)          #数组的维度\n",
    "print(x3.shape)         #数组的形状，每个维度的大小\n",
    "print(x3.size)          #数组的总大小(元素个数)\n",
    "print(x3.dtype)         #数组元素的数据类型\n",
    "print(x3.itemsize)      #数组元素的大小bytes\n",
    "print(x3.nbytes)        #数组总字节大小 一般=size*itemsize"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5, 0, 3, 3, 7, 9])"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[-1]      #和列表一样 可以使用负索引  -1代表最后一个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[-2]     #倒数第二个"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[3, 5, 2, 4],\n",
       "       [7, 6, 8, 8],\n",
       "       [1, 6, 7, 7]])"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[0,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[2,2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[1,-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[-1,-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  5,  2,  4],\n",
       "       [ 7,  6,  8,  8],\n",
       "       [ 1,  6,  7,  7]])"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[0,0]=-3\n",
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5, 0, 3, 3, 7, 9])"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([3, 0, 3, 3, 7, 9])"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[0]=3.14\n",
    "x1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.arange(10)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3, 4])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[:5]  #前5个元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5, 6, 7, 8, 9])"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[5:]   #索引5之后的元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([4, 5, 6])"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[4:7] #索引4到索引7之间的元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 2, 4, 6, 8])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[::2]  #隔一个元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 3, 5, 7, 9])"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[1::2] #从索引1开始 隔一个元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([9, 8, 7, 6, 5, 4, 3, 2, 1, 0])"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[::-1] #逆序数组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5, 3, 1])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[5::-2] #从索引5开始，隔一个元素逆序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  5,  2,  4],\n",
       "       [ 7,  6,  8,  8],\n",
       "       [ 1,  6,  7,  7]])"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  5,  2],\n",
       "       [ 7,  6,  8]])"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[:2,:3]  #前两行 前三列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  2],\n",
       "       [ 7,  8],\n",
       "       [ 1,  7]])"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[:3,::2]  #前三行，每隔一列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 7,  7,  6,  1],\n",
       "       [ 8,  8,  6,  7],\n",
       "       [ 4,  2,  5, -3]])"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[::-1,::-1] #行，列逆序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  5,  2,  4],\n",
       "       [ 7,  6,  8,  8],\n",
       "       [ 1,  6,  7,  7]])"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-3,  7,  1])"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[:,0] #第一列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-3,  5,  2,  4])"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[0,:] #第一行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-3,  5,  2,  4])"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2[0]  #第一行  获取行时，空切片可以省略"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  5,  2,  4],\n",
       "       [ 7,  6,  8,  8],\n",
       "       [ 1,  6,  7,  7]])"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-3,  5],\n",
       "       [ 7,  6]])"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2_sub=x2[:2,:2]\n",
    "x2_sub"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[90,  5],\n",
       "       [ 7,  6]])"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2_sub[0,0]=90\n",
    "x2_sub"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[90,  5,  2,  4],\n",
       "       [ 7,  6,  8,  8],\n",
       "       [ 1,  6,  7,  7]])"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1000,    5,    2,    4],\n",
       "       [   7,    6,    8,    8],\n",
       "       [   1,    6,    7,    7]])"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1000,    5],\n",
       "       [   7,    6]])"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2_sub_copy=x2[:2,:2].copy()\n",
    "x2_sub_copy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[8888,    5],\n",
       "       [   7,    6]])"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2_sub_copy[0,0]=8888\n",
    "x2_sub_copy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1000,    5,    2,    4],\n",
       "       [   7,    6,    8,    8],\n",
       "       [   1,    6,    7,    7]])"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3],\n",
       "       [4, 5, 6],\n",
       "       [7, 8, 9]])"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grid=np.arange(1,10).reshape((3,3))     #将一维数组(长度为9)变为3*3矩阵    \n",
    "grid                                     #原始数组大小与变形后的大小一致"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3])"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1=np.array([1,2,3])\n",
    "x1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3]])"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1.reshape((1,3))          #将一维数组变为二维的行向量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3]])"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[np.newaxis,:]           #将一维数组变为二维的行向量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3]])"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1.reshape((3,1))    #将一维数组变为二维的列向量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [2],\n",
       "       [3]])"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x1[:,np.newaxis]  #将一维数组变为二维的列向量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 3, 2, 1])"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([1,2,3])\n",
    "y=np.array([3,2,1])\n",
    "np.concatenate([x,y])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1,  2,  3,  3,  2,  1, 99, 99, 99])"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "z=np.array([99,99,99])  \n",
    "np.concatenate([x,y,z])  #可以一次性拼接多个数组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3],\n",
       "       [4, 5, 6],\n",
       "       [1, 2, 3],\n",
       "       [4, 5, 6]])"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "grid=np.array([[1,2,3]\n",
    "               ,[4,5,6]])\n",
    "np.concatenate([grid,grid])   #默认按列拼接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3, 1, 2, 3],\n",
       "       [4, 5, 6, 4, 5, 6]])"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.concatenate([grid,grid],axis=1) #按行拼接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2, 3],\n",
       "       [9, 8, 7],\n",
       "       [4, 5, 6]])"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([1,2,3])\n",
    "grid=np.array([[9,8,7],\n",
    "              [4,5,6]])\n",
    "np.vstack([x,grid])     #垂直方向拼接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[9, 8, 7, 1],\n",
       "       [4, 5, 6, 2]])"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y=np.array([[1],[2]])  \n",
    "np.hstack([grid,y])     #水平方向拼接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 2 3] [99 99] [3 2 1]\n"
     ]
    }
   ],
   "source": [
    "x=np.array([1,2,3,99,99,3,2,1])\n",
    "x1,x2,x3=np.split(x,[3,5])  #列表中指定分裂点   N个分裂点 会分成N+1份\n",
    "print(x1,x2,x3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0 1 2 3]\n",
      " [4 5 6 7]] [[ 8  9 10 11]\n",
      " [12 13 14 15]]\n"
     ]
    }
   ],
   "source": [
    "grid=np.arange(16).reshape((4,4))\n",
    "upper,lower=np.vsplit(grid,[2])    #垂直方向分割\n",
    "print(upper,lower)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0  1]\n",
      " [ 4  5]\n",
      " [ 8  9]\n",
      " [12 13]] [[ 2  3]\n",
      " [ 6  7]\n",
      " [10 11]\n",
      " [14 15]]\n"
     ]
    }
   ],
   "source": [
    "left,right=np.hsplit(grid,[2])  \n",
    "print(left,right)  #水平方向分割"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.16666667, 1.        , 0.25      , 0.25      , 0.125     ])"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.seed(0)\n",
    "def compute_reciprocals(values):\n",
    "    output=np.empty(len(values))\n",
    "    for i in range(len(values)):\n",
    "        output[i]=1.0/values[i]\n",
    "    return output\n",
    "values=np.random.randint(1,10,size=5)\n",
    "compute_reciprocals(values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2 s ± 32.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
     ]
    }
   ],
   "source": [
    "big_array=np.random.randint(1,100,size=1000000)\n",
    "%timeit compute_reciprocals(big_array)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.16666667 1.         0.25       0.25       0.125     ]\n",
      "[0.16666667 1.         0.25       0.25       0.125     ]\n"
     ]
    }
   ],
   "source": [
    "print(compute_reciprocals(values))\n",
    "print(1.0/values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2.81 ms ± 45.3 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit 1.0/big_array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.        , 0.5       , 0.66666667, 0.75      , 0.8       ])"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange(5)/np.arange(1,6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  1,   2,   4],\n",
       "       [  8,  16,  32],\n",
       "       [ 64, 128, 256]])"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.arange(9).reshape((3,3))\n",
    "2**x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 3]\n",
      "[5 6 7 8]\n",
      "[-2 -1  0  1]\n",
      "[0 2 4 6]\n",
      "[0.  0.5 1.  1.5]\n",
      "[0 0 1 1]\n"
     ]
    }
   ],
   "source": [
    "x=np.arange(4)\n",
    "print(x)\n",
    "print(x+5)\n",
    "print(x-2)\n",
    "print(x*2)\n",
    "print(x/2)\n",
    "print(x//2)  #地板除法 向下取整"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0 -1 -2 -3]\n",
      "[0 1 4 9]\n",
      "[0 1 0 1]\n"
     ]
    }
   ],
   "source": [
    "print(-x)\n",
    "print(x**2)    #指数运算\n",
    "print(x%2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-1.  , -0.25, -0.  , -0.25])"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "-(0.5*x-1)**2      #运算符组成运算 注意优先级"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 3, 4, 5])"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.add(x,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 1, 0, 1, 2])"
      ]
     },
     "execution_count": 121,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([-2,-1,0,1,2])\n",
    "abs(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 1, 0, 1, 2])"
      ]
     },
     "execution_count": 122,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.absolute(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 1, 0, 1, 2])"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.abs(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5., 5., 1., 2.])"
      ]
     },
     "execution_count": 125,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([3+4j,4+3j,0+1j,2+0j])\n",
    "np.abs(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.        , 1.57079633, 3.14159265])"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "theta=np.linspace(0,np.pi,3)\n",
    "theta"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.0000000e+00 1.0000000e+00 1.2246468e-16]\n",
      "[ 1.000000e+00  6.123234e-17 -1.000000e+00]\n",
      "[ 0.00000000e+00  1.63312394e+16 -1.22464680e-16]\n"
     ]
    }
   ],
   "source": [
    "print(np.sin(theta))\n",
    "print(np.cos(theta))\n",
    "print(np.tan(theta))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[-1  0  1]\n",
      "[-1.57079633  0.          1.57079633]\n",
      "[3.14159265 1.57079633 0.        ]\n",
      "[-0.78539816  0.          0.78539816]\n"
     ]
    }
   ],
   "source": [
    "x=np.array([-1,0,1])\n",
    "print(x)\n",
    "print(np.arcsin(x))\n",
    "print(np.arccos(x))\n",
    "print(np.arctan(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 2.71828183  7.3890561  20.08553692]\n",
      "[2. 4. 8.]\n",
      "[ 3  9 27]\n"
     ]
    }
   ],
   "source": [
    "x=np.array([1,2,3])\n",
    "print(np.exp(x))  #e为底\n",
    "print(np.exp2(x))  #2为底\n",
    "print(np.power(3,x)) #3为底"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1, 2, 4, 10]\n",
      "[0.         0.69314718 1.38629436 2.30258509]\n",
      "[0.         1.         2.         3.32192809]\n",
      "[0.         0.30103    0.60205999 1.        ]\n"
     ]
    }
   ],
   "source": [
    "x=[1,2,4,10]\n",
    "print(x)\n",
    "print(np.log(x))  #e为底\n",
    "print(np.log2(x))  #2为底\n",
    "print(np.log10(x)) #10为底"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 0.1, 0.01, 0.001]\n",
      "[0.         0.10517092 0.01005017 0.0010005 ]\n",
      "[0.         0.09531018 0.00995033 0.0009995 ]\n"
     ]
    }
   ],
   "source": [
    "x=[0,0.1,0.01,0.001]\n",
    "print(x)\n",
    "print(np.expm1(x))  #exp(x)-1\n",
    "print(np.log1p(x))   #log(1+x)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1.0000e+00 2.4000e+01 3.6288e+05]\n",
      "[ 0.          3.17805383 12.80182748]\n",
      "[0.5        0.03333333 0.00909091]\n"
     ]
    }
   ],
   "source": [
    "from scipy import special\n",
    "#Gamma函数和相关函数\n",
    "x=[1,5,10]\n",
    "print(special.gamma(x))\n",
    "print(special.gammaln(x))    #ln|gamma(x)|\n",
    "print(special.beta(x,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.         0.32862676 0.67780119 0.84270079]\n",
      "[1.         0.67137324 0.32219881 0.15729921]\n",
      "[0.         0.27246271 0.73286908        inf]\n"
     ]
    }
   ],
   "source": [
    "#误差函数(高斯积分)的实现与逆实现\n",
    "x=np.array([0,0.3,0.7,1.0])\n",
    "print(special.erf(x))\n",
    "print(special.erfc(x))\n",
    "print(special.erfinv(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0. 10. 20. 30. 40.]\n"
     ]
    }
   ],
   "source": [
    "x=np.arange(5)\n",
    "y=np.empty(5)\n",
    "np.multiply(x,10,out=y)\n",
    "print(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 1.  0.  2.  0.  4.  0.  8.  0. 16.  0.]\n",
      "[ 1.  0.  2.  0.  4.  0.  8.  0. 16.  0.]\n"
     ]
    }
   ],
   "source": [
    "y=np.zeros(10)\n",
    "np.power(2,x,out=y[::2])\n",
    "print(y)\n",
    "\n",
    "y=np.zeros(10)\n",
    "y[::2]=np.power(2,x)\n",
    "print(y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "15"
      ]
     },
     "execution_count": 143,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.arange(1,6)\n",
    "np.add.reduce(x)   #用加法聚合数组x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "120"
      ]
     },
     "execution_count": 144,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.multiply.reduce(x) #用乘法聚合数组x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1,  3,  6, 10, 15])"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.add.accumulate(x) #用加法聚合数组x,并显示每一步的中间结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  1,   2,   6,  24, 120])"
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.multiply.accumulate(x) #用乘法聚合数组x,并显示每一步的中间结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1,  2,  3,  4,  5],\n",
       "       [ 2,  4,  6,  8, 10],\n",
       "       [ 3,  6,  9, 12, 15],\n",
       "       [ 4,  8, 12, 16, 20],\n",
       "       [ 5, 10, 15, 20, 25]])"
      ]
     },
     "execution_count": 147,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.arange(1,6)\n",
    "np.multiply.outer(x,x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "50.461758453195614"
      ]
     },
     "execution_count": 148,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.random.random(100)\n",
    "sum(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "50.46175845319564"
      ]
     },
     "execution_count": 149,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "84.7 ms ± 587 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n",
      "379 µs ± 5.92 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "big_array=np.random.random(1000000)\n",
    "%timeit sum(big_array)\n",
    "%timeit np.sum(big_array)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.071203171893359e-07 0.9999997207656334\n"
     ]
    }
   ],
   "source": [
    "print(min(big_array),max(big_array))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 153,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.071203171893359e-07 0.9999997207656334\n",
      "64.1 ms ± 555 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n",
      "318 µs ± 7.18 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
     ]
    }
   ],
   "source": [
    "print(np.min(big_array),np.max(big_array))\n",
    "%timeit min(big_array)\n",
    "%timeit np.min(big_array)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.071203171893359e-07 0.9999997207656334 500216.8034810001\n"
     ]
    }
   ],
   "source": [
    "print(big_array.min(),big_array.max(),big_array.sum())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0.79832448 0.44923861 0.95274259 0.03193135]\n",
      " [0.18441813 0.71417358 0.76371195 0.11957117]\n",
      " [0.37578601 0.11936151 0.37497044 0.22944653]]\n",
      "5.1136763453287335\n",
      "[0.18441813 0.11936151 0.37497044 0.03193135]\n",
      "[0.95274259 0.76371195 0.37578601]\n"
     ]
    }
   ],
   "source": [
    "M=np.random.random((3,4))\n",
    "print(M)\n",
    "print(M.sum())  #所有元素的和\n",
    "print(M.min(axis=0))  #每一列的最小值\n",
    "print(M.max(axis=1))  #每一行的最大值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 168,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   order               name  height(cm)\n",
      "0      1  George Washington         189\n",
      "1      2         John Adams         170\n",
      "2      3   Thomas Jefferson         189\n",
      "3      4      James Madison         163\n",
      "4      5       James Monroe         183\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "data=pd.read_csv('president_heights.csv')\n",
    "print(data.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[189 170 189 163 183 171 185 168 173 183 173 173 175 178 183 193 178 173\n",
      " 174 183 183 168 170 178 182 180 183 178 182 188 175 179 183 193 182 183\n",
      " 177 185 188 188 182 185]\n",
      "163\n",
      "193\n",
      "6.931843442745892\n",
      "179.73809523809524\n",
      "182.0\n",
      "174.25\n",
      "183.0\n"
     ]
    }
   ],
   "source": [
    "heights=np.array(data['height(cm)'])\n",
    "print(heights)\n",
    "print(heights.min())     #相当于np.min(heights)\n",
    "print(heights.max())\n",
    "print(heights.std())\n",
    "print(heights.mean())\n",
    "print(np.median(heights))     #中位数和分位数不能简写\n",
    "print(np.percentile(heights,25))  #分位数 1/4\n",
    "print(np.percentile(heights,75))  #分位数 3/4\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/sduhao/anaconda3/lib/python3.6/site-packages/matplotlib/font_manager.py:1328: UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans\n",
      "  (prop.get_family(), self.defaultFamily[fontext]))\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEVCAYAAADtmeJyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAF7xJREFUeJzt3Xm4XXV97/H3hwRkEAUlUEBCQEGrIIjRqtQJ8YpFRVErXpwKT9NateBYHB7pVe/T1KG3TlWjqHhRoCJSLEOhqGCfIpogQxCRQSxc0AQHohQRyff+sdYxm5OTZOfknL3OyXq/nmc/Z+211/D9nX3O/uz1W1OqCklSf23RdQGSpG4ZBJLUcwaBJPWcQSBJPWcQSFLPGQSS1HMGgWatJDtN4bL+YAqWsVuSo5LsOBU1bcR6H5rkLUkeM8r1avNhEGjWSPKgJJcmeUGS/YH/TPLCJC9KsnuS7yf55gSPK5NcnGTBwLKemOQHSfZN8mDgliQvGre+Y5IsSbJdki2SnJTkkiRbJXnpuGlfBTwVOBZ4aDvvoQOvZ2B4TpLPJvl6+3xukk+3dQwu8/VtfW9NcuB6fjUHA4uBGljeKUl23pjfr/ornlCm2SDJ54C9gPnAHcADgVXAg4F9gEOAi4G9qurmgfn+CjgfuBFYUFU/TrIl8ETgHcCbgT2BvYGVVXXGwLznAd8BLgDe1657b+BK4LHAoVU19mF+A/Ap4Fvt7K8BDgMeWVX3JHklTUiM90Dg1+3wV6rqo+3ydgVuAY4BbgJ2raovD9R2HDAWXI8AtgGuHnsZ2A74j6o6fj2/VgkwCDRLJJlbVb9rh98HPK6qDk/yN8BXgf+m+eA8nuYD8iDgJ8BtwJ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/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from matplotlib.font_manager import FontProperties           \n",
    "font = FontProperties(fname = \"/Library/Fonts/Songti.ttc\", size=10)  #将之前选择的字体路径赋给fname参数，size设置字体大小\n",
    "\n",
    "plt.hist(heights)\n",
    "plt.title('美国总统身高分布',fontproperties=font)    #在有中文显示的地方，添加fontproperties参数 值为font\n",
    "plt.xlabel('heights(cm)')\n",
    "plt.ylabel('Number');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5, 6, 7])"
      ]
     },
     "execution_count": 176,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=np.array([0,1,2])\n",
    "b=np.array([5,5,5])\n",
    "a+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 177,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([5, 6, 7])"
      ]
     },
     "execution_count": 177,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a+5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 179,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1. 1. 1.]\n",
      " [1. 1. 1.]\n",
      " [1. 1. 1.]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([[1., 2., 3.],\n",
       "       [1., 2., 3.],\n",
       "       [1., 2., 3.]])"
      ]
     },
     "execution_count": 179,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M=np.ones((3,3))\n",
    "print(M)\n",
    "M+a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 182,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2]\n",
      "[[0]\n",
      " [1]\n",
      " [2]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([[0, 1, 2],\n",
       "       [1, 2, 3],\n",
       "       [2, 3, 4]])"
      ]
     },
     "execution_count": 182,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=np.arange(3)\n",
    "b=np.arange(3)[:,np.newaxis]\n",
    "print(a)\n",
    "print(b)\n",
    "a+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2, 3)\n",
      "(3,)\n"
     ]
    }
   ],
   "source": [
    "M=np.ones((2,3))\n",
    "a=np.arange(3)\n",
    "print(M.shape)\n",
    "print(a.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 184,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 2., 3.],\n",
       "       [1., 2., 3.]])"
      ]
     },
     "execution_count": 184,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M+a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(3, 1)\n",
      "(3,)\n"
     ]
    }
   ],
   "source": [
    "a=np.arange(3).reshape(3,1)\n",
    "b=np.arange(3)\n",
    "print(a.shape)\n",
    "print(b.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 186,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 1, 2],\n",
       "       [1, 2, 3],\n",
       "       [2, 3, 4]])"
      ]
     },
     "execution_count": 186,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a+b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(3, 2)\n",
      "(3,)\n"
     ]
    }
   ],
   "source": [
    "M=np.ones((3,2))\n",
    "a=np.arange(3)\n",
    "print(M.shape)\n",
    "print(a.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "operands could not be broadcast together with shapes (3,2) (3,) ",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-189-2267d2681641>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mM\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m: operands could not be broadcast together with shapes (3,2) (3,) "
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "M+a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3, 1)"
      ]
     },
     "execution_count": 190,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a[:,np.newaxis].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 194,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3, 1)"
      ]
     },
     "execution_count": 194,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.reshape(3,1).shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2])"
      ]
     },
     "execution_count": 195,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1.31326169, 1.31326169],\n",
       "       [1.69314718, 1.69314718],\n",
       "       [2.31326169, 2.31326169]])"
      ]
     },
     "execution_count": 196,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.logaddexp(M,a[:,np.newaxis])     #log(exp(a)+exp(b))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.49831076 0.50193438 0.46752888]\n",
      "[[-0.42378289 -0.08349676  0.53186304]\n",
      " [ 0.1714334   0.04523996  0.35958216]\n",
      " [-0.26734032 -0.33910286 -0.18802404]\n",
      " [ 0.08709493  0.40463975 -0.28081862]\n",
      " [-0.42568224 -0.49508048 -0.39219616]\n",
      " [ 0.27283678  0.44309377  0.32643444]\n",
      " [ 0.31419383  0.18112764 -0.37610672]\n",
      " [ 0.23112091 -0.00215657  0.41322288]\n",
      " [ 0.2735726  -0.16584049 -0.11082735]\n",
      " [-0.23344699  0.01157605 -0.28312962]]\n",
      "[-4.44089210e-17  3.33066907e-17 -9.43689571e-17]\n"
     ]
    }
   ],
   "source": [
    "X=np.random.random((10,3))\n",
    "Xmean=X.mean(0)      #对每列求平均值  相当于np.mean(X,axis=0)\n",
    "print(Xmean)\n",
    "X1=X-Xmean           #对矩阵进行平均值归一化\n",
    "print(X1)      \n",
    "print(X1.mean(0))     #值为0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=np.linspace(0,5,50)\n",
    "y=np.linspace(0,5,50)[:,np.newaxis]\n",
    "z=np.sin(x)**10+np.cos(10+y*x)*np.cos(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/sduhao/anaconda3/lib/python3.6/site-packages/matplotlib/font_manager.py:1328: UserWarning: findfont: Font family ['sans-serif'] not found. Falling back to DejaVu Sans\n",
      "  (prop.get_family(), self.defaultFamily[fontext]))\n"
     ]
    },
    {
     "data": {
      "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SGiXwGwG8AoM79jrfuzHES0H8BuZh4UY+6q0s87sdPhScxcB7AUnrQuYeavApjqOuM6gJlfYOZH2j/PAHgKwIVr26uzwy2W8mjn2p91+waJiLYD+EkAH1vrvji9089B7EIABzraB7GOf9EGFSLaCeB1AL65tj1Znvbj2R4ARwDcy8zrub8fBvCrQIoiAesDBvD3RPRwO9xvqOnnIJYqPMlZOURUAfA5AL/MzLaK7jqCmWNmvhKtCI+riGhdPrIT0TsAHGHmh9e6Lz1wDTO/Hq3MMje3pZGhpZ+DmIcnrSJtbelzAP6CmT+/1v1JCzOfBPAVAOs1Tu8aANe1daZPAXgzEf352nZpeZj5UPv/IwC+gJaUM7T0cxDz8KRVoi2UfxzAU8z8+2vdn24Q0QVENN7+eQTAWwA8vba9CsPMtzLzdmbeidY1ex8z/9wad+usEFG5/XIHRFQG8FYMTsaYVaFvgxgzNwEshSc9BeAzKcKT1gwiuhPANwBcTkQHieh9a92nZbgGwLvRukvY0/68fa07tQxbAdxPRI+h9cftXmZe99aFAWEzgK8R0aMAvgXgb5n5S2vcpzXFw44cxxlo3LHvOM5A44OY4zgDjQ9ijuMMND6IOY4z0Pgg5jjOQOODmOM4A40PYo7jDDT/H89nygJsWtO5AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.imshow(z,extent=[0,5,0,5],origin=\"lower\",cmap=\"viridis\")\n",
    "plt.colorbar();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(365,)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "rainfall=pd.read_csv('Seattle2014.csv')['PRCP'].values  #抽取降水量 并放入数组中\n",
    "inches=rainfall/254     #单位化为英寸\n",
    "inches.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEEJJREFUeJzt3X+sZGV9x/H3p6AYf6Qu3QvdLosLZvsDkgr0hlJpWixt+WHaxTQ2S1pdLc1qC42mpglKUk0TUppUTU1bGkQiJhak/qjbiq240hhrFrwQXBYQWWEL627YVSxKTGhZv/1jzq2z6907c+/cuXPvw/uVTObMc54z851nTz5z7nPOzKaqkCS168cmXYAkabwMeklqnEEvSY0z6CWpcQa9JDXOoJekxhn0ktQ4g16SGmfQS1Ljjp90AQBr166tjRs3TroMSVpV7rnnnm9V1dSgfisi6Ddu3MjMzMyky5CkVSXJfw3Tz6kbSWrcwKBPsiHJnUkeSvJAkrd17e9J8s0k93W3S/u2eWeSPUkeTnLRON+AJGl+w0zdPAe8o6ruTfIy4J4kd3Tr3l9Vf93fOckZwBbgTOCngM8n+emqOryUhUuShjPwiL6qDlTVvd3y94CHgPXzbLIZuLWqnq2qx4A9wLlLUawkaeEWNEefZCNwNnBX13RVkl1JbkqypmtbDzzRt9k+5vhgSLItyUySmUOHDi24cEnScIYO+iQvBT4BvL2qvgtcD7wSOAs4ALx3tuscm//I/25SVTdU1XRVTU9NDbw6SJK0SEMFfZIX0Av5j1bVJwGq6smqOlxVPwA+yA+nZ/YBG/o2PwXYv3QlS5IWYpirbgJ8CHioqt7X176ur9vrgN3d8nZgS5ITkpwGbALuXrqSJUkLMcxVN+cDbwDuT3Jf1/Yu4PIkZ9GbltkLvAWgqh5IchvwIL0rdq70ihtJmpyBQV9VX2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mva1bPpMjT8Y+ynhOxg5T49n0ThxtOqp9DXBCt7wWeITxnVAaps51fcuvA3Z2yycCj3X1rumWT5xEjV2/n6F3kiuTGMvuNTZy7BOIr+XIk7F3L+c4DlnjqfTOW736qPaXAC/rW/4ycPG4ahyizp+c/XemF5KPd+M61L6yHDV262cPMF8yybGc9z1M6oWHHOBLga93QXlN1/YX9I6MAV4E/FO3094NnN637TXddg8Dl0ywxs8DTwL3dbftXfurgfu7nfR+4IoJj+VfAg909dwJ/Gzftn/QjfEe4M2TqrF7/B7guqO2W7axpHfUdgD4X3pHllcAbwXe2q0Pvf905xtdLdMTGMdBNd4IfKdvn5zp2k/vxvCr3b5wzZj3yUF1XtW3T+6k74Nprn1lEjV2fd5E7+KP/u2WdSwH3fxmrCQ1biXP0UuSloBBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4/4PHdlUBai0xbYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.hist(inches,40);     #加分号 避免打印中间值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True,  True, False, False, False])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([1,2,3,4,5])\n",
    "x<3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False, False,  True,  True])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x>3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True,  True,  True, False, False])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x<=3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False,  True,  True,  True])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x>=3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False,  True, False, False])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x==3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True,  True, False,  True,  True])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x!=3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False,  True, False,  True, False])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2**x==x**2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[5 0 3 3]\n",
      " [7 9 3 5]\n",
      " [2 4 7 6]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([[ True,  True,  True,  True],\n",
       "       [False, False,  True,  True],\n",
       "       [ True,  True, False, False]])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng=np.random.RandomState(0)\n",
    "x=rng.randint(10,size=(3,4))\n",
    "print(x)\n",
    "x<6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[5 0 3 3]\n",
      " [7 9 3 5]\n",
      " [2 4 7 6]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(x)\n",
    "np.count_nonzero(x<6)  #统计True的个数 即小于6的数字个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(x<6)         #False=0,True=1 因此也可以用np.sum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([4, 2, 2])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(x<6,axis=1)   #统计矩阵中 每一行<6的数字个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.any(x>8)  #有没有值大于8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.any(x>10) #有没有值大于10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.all(x<10)  #是否所有值小于10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.all(x==6)  #是否所有值等于6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True, False,  True])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.all(x<8,axis=1)  #是否每行的值都小于8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "29"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum((inches>0.5)&(inches<1))    #降水量大于0.5且小于1的天数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "29"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sum(~((inches<=0.5)|(inches>=1)))  #a and b 等价于 not(非a or 非b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "215\n",
      "150\n",
      "37\n",
      "75\n"
     ]
    }
   ],
   "source": [
    "print(np.sum(inches==0))    #不下雨的天数\n",
    "print(np.sum(inches!=0))    #下雨的天数\n",
    "print(np.sum(inches>0.5))   #降水量大于0.5英寸的天数\n",
    "print(np.sum((inches>0)&(inches<0.2)))#降水量在0～0.2英寸之间的天数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5, 0, 3, 3],\n",
       "       [7, 9, 3, 5],\n",
       "       [2, 4, 7, 6]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[False,  True,  True,  True],\n",
       "       [False, False,  True, False],\n",
       "       [ True,  True, False, False]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x<5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 3, 3, 3, 2, 4])"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x[x<5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.19488188976377951\n",
      "0.0\n",
      "0.8503937007874016\n",
      "0.20078740157480315\n"
     ]
    }
   ],
   "source": [
    "rainy=inches>0   #为下雨天创建一个掩码\n",
    "summer=(np.arange(365)-172>0)&(np.arange(365)-172<90)    #为夏天创建一个掩码 6月21号是第172天\n",
    "\n",
    "print(np.median(inches[rainy]))   #雨天降水量的中位数\n",
    "print(np.median(inches[summer]))   #夏天降水量的中位数\n",
    "print(np.max(inches[summer]))    #夏天降水量的最大值\n",
    "print(np.median(inches[~summer&rainy]))  #非夏天的下雨天 降水量的中位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bool(42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bool(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bool(42 and 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bool(42 or 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0b101010'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bin(42)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0b111011'"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bin(59)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0b101010'"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bin(42 & 59)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'0b111011'"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bin(42 | 59)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ True,  True,  True,  True,  True])"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A=np.array([1,0,0,1,1],dtype=bool)\n",
    "B=np.array([0,1,1,0,1],dtype=bool)\n",
    "A|B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-44-ea2c97d9d9ee>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mA\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mB\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "A or B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([False, False, False, False, False,  True,  True,  True, False,\n",
       "       False])"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.arange(10)\n",
    "(x>4)&(x<8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-47-7e93193ef4c6>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m>\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;32mand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m<\u001b[0m\u001b[0;36m8\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
     ],
     "output_type": "error"
    }
   ],
   "source": [
    "(x>4)and(x<8)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[51 92 14 71 60 20 82 86 74 74]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[14, 86, 14]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "rand=np.random.RandomState(42)\n",
    "x=rand.randint(100,size=10)\n",
    "print(x)\n",
    "[x[2],x[7],x[2]]     #同时获取三个索引值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([14, 71, 20])"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ind=[2,3,5]\n",
    "x[ind]          #也可以传入一个索引列表或数组"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[71, 86],\n",
       "       [60, 20]])"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ind=np.array([[3,7],[4,5]])\n",
    "x[ind]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0  1  2  3]\n",
      " [ 4  5  6  7]\n",
      " [ 8  9 10 11]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([ 1,  6, 11])"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X=np.arange(12).reshape((3,4))\n",
    "print(X)\n",
    "row=np.array([0,1,2])\n",
    "col=np.array([1,2,3])\n",
    "X[row,col]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1,  2,  3],\n",
       "       [ 5,  6,  7],\n",
       "       [ 9, 10, 11]])"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X[row[:,np.newaxis],col]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 0, 0],\n",
       "       [1, 2, 3],\n",
       "       [2, 4, 6]])"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row[:,np.newaxis]*col      #索引数组的形状  结果和索引数组的形状一致  不是和被索引数组X一致"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0  1  2  3]\n",
      " [ 4  5  6  7]\n",
      " [ 8  9 10 11]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([ 8, 10,  9])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(X)\n",
    "X[2,[0,2,1]]   #（2，0） （2，2）  （2，1）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 4,  6,  5],\n",
       "       [ 8, 10,  9]])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X[1:,[0,2,1]]  #(1,0)  (1,2)  (1,1)\n",
    "               #(2,0)   (2,2)  (2,1)\n",
    " "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0,  2],\n",
       "       [ 4,  6],\n",
       "       [ 8, 10]])"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mask=np.array([1,0,1,0],dtype=bool)\n",
    "X[row[:,np.newaxis],mask]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(100, 2)"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean=[0,0]\n",
    "cov=[[1,2],[2,5]]\n",
    "X=rand.multivariate_normal(mean,cov,100)  #生成100个 2维正态分布的点\n",
    "X.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x115f2f780>"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGgxJREFUeJzt3X+QXXV5x/HPk83CLFhZHOI4WbIER12khmbLCrRpa4nWxR+FLWiR1tbWmWZ01BHGribCyNDikHFnCk7rtJMR2z9IIdbEbSu2izRYW2ZC3bjBgMkqYyVwo2UpLjpwSzabp3/s3rA/zrn3nHu+5/449/2acYa9e++536vyOd997nOeY+4uAEBxrGn2AgAAYRHsAFAwBDsAFAzBDgAFQ7ADQMEQ7ABQMAQ7ABQMwQ4ABUOwA0DBrG3Gm5533nm+cePGZrw1ALStgwcPPuvu62o9rynBvnHjRk1OTjbjrQGg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{},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.scatter(X[:,0],X[:,1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[21 85 49 80 19 91 83 17 50 29  9 11 55 96 94 73 70 66  7  4]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(20, 2)"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ind=np.random.choice(X.shape[0],20,replace=False)  #X.shape[0]=100  随机生成100以内的20个不重复（replace=False）的索引值\n",
    "print(ind)\n",
    "s1=X[ind]\n",
    "s1.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x115e03208>"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAD8CAYAAABjAo9vAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl4lNX1wPHvnX2yMdmJhFVBxSUqKGjdEFHcaK3W3aKtUrVubW3r1rpU7fprrVoXFLXu1n2ppeJuXRC0bIIgBYFASAjJJJPJ7HN/f1yykmQmmQkhw/k8D49k8s47d4b2vHfOe+65SmuNEEKIzGEZ6AEIIYRILwnsQgiRYSSwCyFEhpHALoQQGUYCuxBCZBgJ7EIIkWEksAshRIaRwC6EEBlGArsQQmQY20C8aFFRkR41atRAvLQQQgxan3/+ea3WujjRcQMS2EeNGsXChQsH4qWFEGLQUkqtS+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K3Q58H2gApgzwcPrbD4BnB3oQIinDgA3tfq4EJg3QWESKlFKjgAOB+QM7kuTs9IG9p37wWutXtNY3ADcopa4DLgdu2qEDTINE73HbMTdgvho+uSPHlg7JvL8MpLp4LOO+Ue4KlFI5wAvA1Z2yBDutnT6wa6273LijC08B/2QQBvZE71EpNRM4GZiqB2F9ai/+DTNJJTC83c/l7IRbR4qeKaXsmKD+pNb6xYEeT7IGdY5dKTW23Y8zgK8Gaiz9RSk1HfglMENr3TzQ4xFJWwCMVUqNVko5gLOAVwd4TKIXtm0eNAdYobX+80CPpzcG9QIlpdQLwJ5AHNMt8hKt9caBHVV6KaVWA05g67aHPtVaXzKAQ0orpdSpwN1AMeAFFmmtjx/YUaWHUupE4E7ACjystb59gIeUVkqpp4GjMZ0Pq4GbtNZzBnRQaaSUOhz4EFiKiTEA12ut3xi4USVnUAd2IYQQ2xvUqRghhBDbk8AuhBAZRgK7EEJkGAnsQgiRYSSwCyFEhpHALoQQGUYCuxBCZBgJ7EIIkWH+Hx6cgcYMj8ahAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[:,0],X[:,1],alpha=0.3)\n",
    "plt.scatter(s1[:,0],s1[:,1],facecolor='none',edgecolors='b',s=200)     #把选择的点在原图标出"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0 1 2 3 4 5 6 7 8 9]\n",
      "[ 0  1 99  3 99  5 99  7 99  9]\n",
      "[ 0  1 89  3 89  5 89  7 89  9]\n"
     ]
    }
   ],
   "source": [
    "x=np.arange(10)\n",
    "ind=[2,4,6,8]\n",
    "print(x)\n",
    "x[ind]=99\n",
    "print(x)\n",
    "x[ind]-=10\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]\n",
      "[6. 0. 0. 0. 0. 0. 0. 0. 0. 0.]\n"
     ]
    }
   ],
   "source": [
    "x=np.zeros(10)\n",
    "print(x)\n",
    "x[[0,0]]=[4,6]    #后者把者覆盖了\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[6. 0. 0. 0. 0. 0. 0. 0. 0. 0.]\n",
      "[6. 0. 1. 1. 1. 0. 0. 0. 0. 0.]\n"
     ]
    }
   ],
   "source": [
    "i=[2,3,3,4,4,4]\n",
    "print(x)\n",
    "x[i]+=1              #虽然有重复的索引 但并没有发生累加  只发生了赋值\n",
    "print(x)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([6., 0., 1., 2., 3., 0., 0., 0., 0., 0.])"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.add.at(x,i,1)\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x115d55470>]"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAADBpJREFUeJzt3V+IpXUdx/HPJzWCdEjZ0abRaSUknP6NMDjKXmRtmpk5dhGbQ7KQsF4o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5026mnQ+5XtuW7O0spi0F6vxGseFNlfM4dcACAJgg4ASRD07uxqeoAeG7TXK/GaB0Xq18wxdABIghU6ACRB0DfA9s22w/ampmepm+0f237R9nO2H7P9iaZnqsugXezc9lm2n7J9yPYLtm9oeqZesH2C7b/b/n3Ts9SFoHfJ9lmSLpZ0uOlZemSvpM9HxBcl/UvSrQ3PU4sBvdj5UUk3RcS5ki6QdN0AvGZJukHSoaaHqBNB7949kn6gNS6zl1FEPBkRR9t3/yrpzCbnqdHAXew8IloR8Uz79jtaiVzq68zZPlPSNyX9uulZ6kTQu2D7CkmLEfFs07M05PuS/tD0EDVZ62LnqeO2mu3Nks6TdKDZSWr3U60syN5repA6lbrARSa2/yzpk2t863ZJt0m6pLcT1e/DXnNEzLa3uV0r/4v+QC9n66GuLnaeke2TJT0i6caIWG56nrrYvlzSkYg4aPuipuepE0Fvi4ivrfW47S9IOlvSs7allUMPz9g+PyL+08MRK7feaz7G9nZJl0vaGnnf3/q6pLNW3T9T0hsNzdIztk/SSswfiIhHm56nZlskXWH7MkkfkzRk+zcR8b2G56oc70PfINuvSpqMiH78gJ+u2b5U0t2SvhwRS03PUxfbJ2rlH323SlrUysXPZzJfH9crK5Pdkt6OiBubnqeX2iv0myPi8qZnqQPH0LGen0k6RdJe2/O2f9n0QHVo/8PvsYudH5L0cOaYt22RdLWkr7b/2863V6/oc6zQASAJVugAkARBB4AkCDoAJEHQASAJgg4ASRB0AEiCoANAEgQdAJL4H4Arudm6BjV6AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "np.random.seed(42)\n",
    "x=np.random.randn(100)       #生成100个随机数\n",
    "\n",
    "bins=np.linspace(-5,5,20)    #在（-5，5）之间划分20个区间\n",
    "counts=np.zeros_like(bins)   #每个区间的数据数量 初始化为0\n",
    "\n",
    "i=np.searchsorted(bins,x)    #确定x中的每个随机数属于哪个区间\n",
    "np.add.at(counts,i,1)        #确定每个区间数据的数量   有重复索引 累加时用at()\n",
    "\n",
    "plt.plot(bins,counts,linestyle='steps')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([ 0.,  0.,  0.,  0.,  1.,  3.,  7.,  9., 23., 22., 17., 10.,  7.,\n",
       "         1.,  0.,  0.,  0.,  0.,  0.]),\n",
       " array([-5.        , -4.47368421, -3.94736842, -3.42105263, -2.89473684,\n",
       "        -2.36842105, -1.84210526, -1.31578947, -0.78947368, -0.26315789,\n",
       "         0.26315789,  0.78947368,  1.31578947,  1.84210526,  2.36842105,\n",
       "         2.89473684,  3.42105263,  3.94736842,  4.47368421,  5.        ]),\n",
       " <a list of 1 Patch objects>)"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACy9JREFUeJzt3X+o3fddx/HX23ZicJN0JK0la7xDiqz4o4NQBvnDmtpR17LOPwQrjoKD+McGLWzIdftD/4yIm38oSnRlBetksJUWW3W1HZQVHaa1my3Z7BhxNo1NSgmrEJBub//IKYQ26T33/Lgn93MfDwj3nO/9nnzfX1Ke99vvPd/vqe4OANvfj616AAAWQ9ABBiHoAIMQdIBBCDrAIAQdYBCCDjAIQQcYhKADDOLKrdzYnj17em1tbSs3CbDtPf300690996N1tvSoK+treXYsWNbuUmAba+q/mua9ZxyARiEoAMMQtABBiHoAIMQdIBBCDrAIAQdYBCCDjAIQQcYxJZeKQqzOnjkiZw8e27m1+/bvStPrR9a4ERw+RF0toWTZ8/lxJHbZ3792vojC5wG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jOrnmdZqurKnP+l7y1JTub8LS1+a+Srnuv8kcn9SV7t7ntXPc9Wmhyhf6q771j1LMvgHDqX8mdJ3pXksap6tqr+ctUDLcPkF79v3MLieJIvjRzziYNJPprk0OTf9tnJ0SvbnCN0gEE4QgcYhKADDELQAQYh6ACDEHSAQQg6wCAEHWAQgg4wiP8Hp6NPA4PMaVQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.hist(x,bins,histtype='step')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "56.5 µs ± 234 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)\n",
      "17.4 µs ± 47.3 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit counts,edge=np.histogram(x,bins)        #NumPy计算区间中数据量的方法\n",
    "%timeit np.add.at(counts,np.searchsorted(bins,x),1)  #我们之前使用的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "69.3 ms ± 744 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n",
      "129 ms ± 395 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n"
     ]
    }
   ],
   "source": [
    "x=np.random.randn(1000000)\n",
    "%timeit counts,edge=np.histogram(x,bins)        #NumPy计算区间中数据量的方法\n",
    "%timeit np.add.at(counts,np.searchsorted(bins,x),1)  #我们之前使用的方法"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 2 3 4 5]\n",
      "[2 1 4 3 5]\n"
     ]
    }
   ],
   "source": [
    "x=np.array([2,1,4,3,5])\n",
    "print(np.sort(x))\n",
    "print(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 2, 3, 4, 5])"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([2,1,4,3,5])\n",
    "x.sort()\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1 0 3 2 4]\n",
      "[2 1 4 3 5]\n",
      "[1 2 3 4 5]\n"
     ]
    }
   ],
   "source": [
    "x=np.array([2,1,4,3,5])\n",
    "i=np.argsort(x)\n",
    "print(i)\n",
    "print(x)\n",
    "print(x[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[6 3 7 4 6 9]\n",
      " [2 6 7 4 3 7]\n",
      " [7 2 5 4 1 7]\n",
      " [5 1 4 0 9 5]]\n",
      "[[2 1 4 0 1 5]\n",
      " [5 2 5 4 3 7]\n",
      " [6 3 7 4 6 7]\n",
      " [7 6 7 4 9 9]]\n",
      "[[3 4 6 6 7 9]\n",
      " [2 3 4 6 7 7]\n",
      " [1 2 4 5 7 7]\n",
      " [0 1 4 5 5 9]]\n"
     ]
    }
   ],
   "source": [
    "rand=np.random.RandomState(42)\n",
    "x=rand.randint(0,10,(4,6))\n",
    "print(x)\n",
    "print(np.sort(x,axis=0))  #按列排序\n",
    "print(np.sort(x,axis=1))  #按行排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 1, 3, 4, 6, 5, 7])"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x=np.array([7,2,3,1,6,5,4])\n",
    "np.partition(x,3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[77 25  6 84]\n",
      " [38 65 26 82]\n",
      " [19 69 63 78]\n",
      " [92 55 77 26]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "array([[ 6, 25, 77, 84],\n",
       "       [26, 38, 65, 82],\n",
       "       [19, 63, 69, 78],\n",
       "       [26, 55, 77, 92]])"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X=np.random.randint(0,100,16).reshape((4,4))\n",
    "print(X)\n",
    "np.partition(X,2,axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.00706631, 0.02306243],\n",
       "       [0.52477466, 0.39986097],\n",
       "       [0.04666566, 0.97375552],\n",
       "       [0.23277134, 0.09060643],\n",
       "       [0.61838601, 0.38246199],\n",
       "       [0.98323089, 0.46676289],\n",
       "       [0.85994041, 0.68030754],\n",
       "       [0.45049925, 0.01326496],\n",
       "       [0.94220176, 0.56328822],\n",
       "       [0.3854165 , 0.01596625]])"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X=rand.rand(10,2)\n",
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x11641fc18>"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0c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pHB/IuIAMAD80pJWtLTm7W9EdAFfBH6tWQU1QZGfcQ/1qZmPUz8zG4qIhzPzX5a4tqVQpL/7gS9n5n+PiF8AvtLo79TSl9cSS5pbnTByvwY8NO14A/eerr3fJiJ6qJ/SzXc61O6K9JmI+CTwOeCxzBxvUm1LYaH+fhh4GPhmRPyQ+vzkqQ7/UrXo7/WfZ+ZEZr4FjFAP+05UpL9PAi8DZOZ3gA9RX4Olqgr9nX9QnRDurwHbImJLRKyk/oXpqRltTgG/2nj8KeCvs/GNRYdasM+NaYo/oh7snTwXCwv0NzPfycw1mbk5MzdT/47hscwcbk25pSjye32S+hfnRMQa6tM0o02tsjxF+vv3wCcAIuJnqYf7zaZW2VyngF9pXDXzMeCdzPxRae/e6m+UC37r/Cjwf6l/2/65xnPPUf8Dh/ovwZ8Bl4HzwNZW19yEPv8f4B+B7zX+nWp1zUvZ3xltv0mHXy1T8GccwP8A3gT+Fnii1TUvcX93AN+mfiXN94D/2Oqa77O/XwV+BExQH6U/CXwa+PS0n+8Ljf8ff1v277R3qEpSBXXCtIwkaZEMd0mqIMNdkirIcJekCjLcJamCDHdJqiDDXZIqyHCXpAr6f6OV3xtxFvULAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.scatter(X[:,0],X[:,1],s=100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(10, 10)"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dist_sq=np.sum((X[:,np.newaxis,:]-X[np.newaxis,:,:])**2,axis=-1)      #axis=-1 沿第三维求和\n",
    "dist_sq.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(10, 10, 2)\n",
      "(10, 10, 2)\n",
      "(10, 10)\n"
     ]
    }
   ],
   "source": [
    "differences=X[:,np.newaxis,:]-X[np.newaxis,:,:]     #计算这些数据点 两两之间的坐标差\n",
    "print(differences.shape)\n",
    "sq=differences**2                  #求差值的平方\n",
    "print(sq.shape)\n",
    "dist_sq=sq.sum(-1)                 #对每个点的横纵坐标差值平方求和 得平方距离  -1沿第三维求和\n",
    "print(dist_sq.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dist_sq.diagonal()   #取出矩阵对角线的值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0, 3, 9, 7, 1, 4, 2, 5, 6, 8],\n",
       "       [1, 4, 7, 9, 3, 6, 8, 5, 0, 2],\n",
       "       [2, 1, 4, 6, 3, 0, 8, 9, 7, 5],\n",
       "       [3, 9, 7, 0, 1, 4, 5, 8, 6, 2],\n",
       "       [4, 1, 8, 5, 6, 7, 9, 3, 0, 2],\n",
       "       [5, 8, 6, 4, 1, 7, 9, 3, 2, 0],\n",
       "       [6, 8, 5, 4, 1, 7, 9, 3, 2, 0],\n",
       "       [7, 9, 3, 1, 4, 0, 5, 8, 6, 2],\n",
       "       [8, 5, 6, 4, 1, 7, 9, 3, 2, 0],\n",
       "       [9, 7, 3, 0, 1, 4, 5, 8, 6, 2]])"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nearest=np.argsort(dist_sq,axis=1)\n",
    "nearest\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [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0DfJn4ZF18fbwwQJUqVVmwejs9e/bk2rVrPPHEE/Tu3Zu4uDhHl6qUUnZh0o6H5r7g4GDJC9dz//LLLxk8eDApKSmUKVOGr7/+mscee8zRZSmlVIaMMZEiEpxZO5fYc7+fAQMGEBERQfny5Tl37hwhISEMGTKEK1euOLo0pZTKMpcPd4D69esTExNDSEgIAHPmzKFu3bqsX7/esYUppVQWabinK168OCtXrmT8+PEAnD59mtatW/Pyyy9z/fp1B1enlFIPRsP9FhaLhQkTJhAWFoaXlxeenp7MmDEDf39/fvnlF0eXp5RSNtNwz0Dnzp2JjIykZs2aAFy4cIHmzZszevRoEhISHFydUkplTsP9HqpXr86WLVvo27cvsbGxVKxYkcmTJxMUFERemOWjlFL3o+F+H4UKFWL+/PnMmDGDU6dOUa5cOS5cuEDjxo154403SExMdHSJSimVIQ33TBhjeOmll6wzZy5fvkyTJk149913adiwIbt27XJsgUoplQENdxs1a9aMqKgoGjRowObNm+ncuTNnzpwhODiYd955h6SkJEeXqJRSVhruD6Bs2bKsXbuWESNGEB4eTuXKlencuTNvvvkmTZs2Zd++fY4uUSmlAA33B+bh4cH06dNZuHAhMTExbNu2jbfeeoujR48SGBjI5MmTSUlJcXSZSikXp+GeRb1792bbtm0UKVKEd955hxEjRtCxY0dGjx5NixYtOHTokKNLVEq5MA33bPDz82PHjh106tSJN954Ay8vLz7//HP27duHv78/n3zyCampqY4uUynlgjTcs6lYsWIsW7aMd999l0WLFvHRRx+xfPlyWrVqxSuvvEKbNm04evSoo8tUSrkYDXc7sFgs/POf/2TVqlWcOnWKxx9/nBdeeIHPP/+cqKgo6taty6xZs3DU5ZWVUq5Hw92OQkJCiIyMpHr16nTr1o1jx46xa9cumjRpwtChQ+nQoQPHjx93dJlKKReg4W5nVapUYfPmzfTv3593332XoUOHsmjRIj777DM2b96Mn58fX331le7FK6VylIZ7DvDy8uKLL75g1qxZrFu3juDgYBo3bszu3bvx9/enf//+dO3aldOnTzu6VKWUk9JwzyHGGIYMGcKmTZ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q+OPpJsw5HmTsBB0o6w/zP9ubdJ+8cNaT/4b4HDwHagmqNrzoVtXgOcBXam35Y7uuac3uY72q4nn8+WsfHnbIBpwD5gD9Db0TXn0nbXBn4mbSbNTuAxR9ecze1dCJwGkkjbSx8IvAC8cMvP+dP0/x977PW7rWeoKqWUE8rrwzJKKaWyQMNdKaWckIa7Uko5IQ13pZRyQhruSinlhDTclVLKCWm4K6WUE9JwV0opJ/T/69X7a68Sy8cAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "K=2\n",
    "nearest_par=np.argpartition(dist_sq,K+1,axis=1)    #距离每个点最近的两个点  K+1不包括自身\n",
    "#可视化 让每个点与其两个最近邻连线\n",
    "plt.scatter(X[:,0],X[:,1])\n",
    "for i in range(X.shape[0]):      #i表示第几个点\n",
    "    for j in nearest_par[i,:K+1]:  #j表示与i点 距离前K+1近的点的索引\n",
    "        plt.plot(*zip(X[j],X[i]),color='black')    #zip() x[i],x[j]间的连线\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [],
   "source": [
    "name=['alice','bob','cc','dog']\n",
    "age=[25,45,37,19]\n",
    "weight=[55,85.5,68,61.5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[('name', '<U10'), ('age', '<i4'), ('weight', '<f8')]\n"
     ]
    }
   ],
   "source": [
    "data=np.zeros(4,dtype={'names':('name','age','weight'),'formats':('U10','i4','f8')})\n",
    "print(data.dtype)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[('alice', 25, 55. ) ('bob', 45, 85.5) ('cc', 37, 68. ) ('dog', 19, 61.5)]\n"
     ]
    }
   ],
   "source": [
    "data['name']=name\n",
    "data['age']=age\n",
    "data['weight']=weight\n",
    "print(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['alice', 'bob', 'cc', 'dog'], dtype='<U10')"
      ]
     },
     "execution_count": 126,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['name']  #获取所有的名字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('alice', 25, 55.)"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0]    #获取第一行数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'dog'"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[-1]['name']   #获取最后一行数据的名字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['alice', 'dog'], dtype='<U10')"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['age']<30]['name']   #获取年龄小于30的人的名字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype([('name', '<U10'), ('age', '<i4'), ('weight', '<f8')])"
      ]
     },
     "execution_count": 130,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dtype({'names':('name','age','weight'),'formats':('U10','i4','f8')})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype([('name', '<U10'), ('age', '<i8'), ('weight', '<f4')])"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dtype({'names':('name','age','weight'),'formats':((np.str_,10),int,np.float32)})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype([('name', 'S10'), ('age', '<i4'), ('weight', '<f8')])"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dtype([('name','S10'),('age','i4'),('weight','f8')])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype([('f0', 'S10'), ('f1', '<i4'), ('f2', '<f8')])"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dtype('S10,i4,f8')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(0, [[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]])\n",
      "[[0. 0. 0.]\n",
      " [0. 0. 0.]\n",
      " [0. 0. 0.]]\n"
     ]
    }
   ],
   "source": [
    "tp=np.dtype([('id','i8'),('mat','f8',(3,3))])\n",
    "X=np.zeros(1,dtype=tp)\n",
    "print(X[0])\n",
    "print(X['mat'][0])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([25, 45, 37, 19], dtype=int32)"
      ]
     },
     "execution_count": 138,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['age']       #之前例子中获取年龄数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([25, 45, 37, 19], dtype=int32)"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data1=data.view(np.recarray)     #把之前的data数组变成记录数组\n",
    "data1.age                       #像调用属性一样获取年龄数据  按键更少"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "175 ns ± 0.748 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)\n",
      "4.36 µs ± 84.1 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n",
      "3.33 µs ± 24.9 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
     ]
    }
   ],
   "source": [
    "%timeit data['age']\n",
    "%timeit data1.age\n",
    "%timeit data1['age']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
